package zxzx.controller.AcctBsSgmtController;

import java.util.List;
import java.util.Optional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import zxzx.controller.AcctBsSgmtService.AcctBsSgmtService;
import zxzx.controller.pojo.AcctBsSgmt;
import zxzx.controller.pojo.Result;

@RestController
@RequestMapping("acctBsSgmt")
public class AcctBsSgmtController {

	@Autowired
	private AcctBsSgmtService acctBsSgmtService;
	
	@RequestMapping("save")
	public Result  save(@RequestBody AcctBsSgmt acctBsSgmt) {
		acctBsSgmtService.save(acctBsSgmt);
		return new Result(true, "保存成功");
	}
	@RequestMapping("/findAll")
	public List<AcctBsSgmt> findAll(){
		return acctBsSgmtService.findAll();
	}
	@RequestMapping("/findOne/{id}")
	public Optional<AcctBsSgmt> findOne(@PathVariable Integer id){
		return acctBsSgmtService.findById(id);
	}
	@RequestMapping("/update")
	public Result update(@RequestBody AcctBsSgmt acctBsSgmt){
		acctBsSgmtService.update(acctBsSgmt);
		return new Result(true, "修改成功");
	}
	@RequestMapping("/createXml/{id}")
	public Result createXml(@PathVariable Integer id){
		acctBsSgmtService.createXml(id);
		return new Result(true, "生成成功");
	}
	
	
	
	
	
}
